package com.greatchn.authorization_server.web.po;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @OauthRoleFunctionConnection:
 * @author: ZBoHang
 * @time: 2023/2/28 10:23
 */
@Entity
@Table(name = "oauth_role_function_connection", schema = "sso", catalog = "")
public class OauthRoleFunctionConnection implements Serializable {
    private Integer id;
    private Integer roleGroupId;
    private Integer belongToUserGroupId;
    private Integer functionId;
    private Timestamp createTime;

    @Id
    @Column(name = "id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "role_group_id", nullable = true)
    public Integer getRoleGroupId() {
        return roleGroupId;
    }

    public void setRoleGroupId(Integer roleGroupId) {
        this.roleGroupId = roleGroupId;
    }

    @Basic
    @Column(name = "belong_to_user_group_id", nullable = true)
    public Integer getBelongToUserGroupId() {
        return belongToUserGroupId;
    }

    public void setBelongToUserGroupId(Integer belongToUserGroupId) {
        this.belongToUserGroupId = belongToUserGroupId;
    }

    @Basic
    @Column(name = "function_id", nullable = true)
    public Integer getFunctionId() {
        return functionId;
    }

    public void setFunctionId(Integer functionId) {
        this.functionId = functionId;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OauthRoleFunctionConnection that = (OauthRoleFunctionConnection) o;
        return Objects.equals(id, that.id) && Objects.equals(roleGroupId, that.roleGroupId) && Objects.equals(belongToUserGroupId, that.belongToUserGroupId) && Objects.equals(functionId, that.functionId) && Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, roleGroupId, belongToUserGroupId, functionId, createTime);
    }
}
